/**
 * Created by gongxun on 17/1/14.
 */

var GsbdxTableCardType = GameBaseItem.extend({
    Panel_ttz : null,
    Image_ttz : null,
    ctor : function(){
        this._super();
        this.loadCocostudio("res/ccs/GsbdxTableCardType.json");
        this.Panel_ttz = mo.seekWidgetByName(this.ccsNode, "Panel_ttz");
        this.Image_ttz = mo.seekWidgetByName(this.ccsNode, "Image_ttz");
    },

    showCardType : function(type, isAnim){
        this.setVisible(true);
        this.Image_ttz.setVisible(false);
        this.Image_ttz.setScale(1);
        this.Image_ttz.setOpacity(255);
        this.Image_ttz.stopAllActions();
        mo.gameHelper.loadTextureImage(this.Image_ttz, "ttz_dian_" + type + ".png", ccui.Widget.PLIST_TEXTURE);

        if (isAnim){
            this.Image_ttz.setVisible(true);
            this.Image_ttz.setOpacity(0);
            this.Image_ttz.setScale(3);
            this.Image_ttz.runAction(cc.sequence(
                cc.delayTime(0.5),
                cc.spawn(
                    cc.fadeIn(0.3),
                    cc.scaleTo(0.3, 1)
                )
            ));
        }else{
            this.Image_ttz.setVisible(true);
        }
    }
});